<?php
class fs_databases extends CI_Model {

    var $title   = '';
    var $content = '';
    var $date    = '';

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }

     function get_databases()
    {
        $dbs = array();
        $query = $this->db->query('SHOW databases');

        foreach ($query->result() as $row)
        {
           array_push($dbs, array("name" => $row->Database));
        }

        return $dbs;
    }

    function get_databases_url()
    {
        $dbs = array();
        $query = $this->db->query('SHOW databases');

        foreach ($query->result() as $row)
        {
           array_push($dbs, array("name" => $row->Database, "url" => "site/dashboard/" . $row->Database));
        }

        return $dbs;
    }

}
